<template>
    <div class="container">
        <div class="handle-box">
                <el-form ref="form" :model="form" label-width="90px" class="flex">
                    <el-form-item label="街道名称：">
                        <el-input v-model="name" placeholder="请输入名称" class="handle-input mr10"></el-input>
                    </el-form-item>
                    <!-- <el-form-item label="日期范围：">
                       <el-date-picker
                            v-model="value1"
                            type="daterange"
                            range-separator="至"
                            start-placeholder="开始日期"
                            end-placeholder="结束日期">
                        </el-date-picker>
                    </el-form-item> -->
                    <el-form-item>
                        <el-button type="primary" icon="el-icon-search">搜索</el-button>
                        <el-button type="success" icon="el-icon-circle-plus-outline" @click="addvialog()">新增</el-button>
                    </el-form-item>
                    
                </el-form>
            </div>
            <el-table
                :data="tableData.slice((currentPage-1)*pagesize,currentPage*pagesize)"
            >
                <el-table-column prop="id" label="ID" width="55" align="center"></el-table-column>
                <el-table-column prop="address" label="街道名称"></el-table-column>
                <!-- <el-table-column prop="date" label="日期范围"></el-table-column> -->
                <!-- <el-table-column prop="integral" label="可回收垃圾累计积分"></el-table-column> -->
                <!-- <el-table-column prop="score" label="可回收垃圾消费积分"></el-table-column> -->
                <!-- <el-table-column prop="remaining" label="可回收垃圾剩余积分"></el-table-column> -->
                <!-- <el-table-column prop="chuyuintegral" label="厨余收垃圾累计积分"></el-table-column> -->
                <!-- <el-table-column prop="chuyuscore" label="厨余收垃圾消费积分"></el-table-column> -->
                <!-- <el-table-column prop="chuyuremaining" label="厨余收垃圾剩余积分"></el-table-column> -->
                <!-- <el-table-column prop="youhaiintegral" label="有害收垃圾累计积分"></el-table-column> -->
                <!-- <el-table-column prop="youhaiscore" label="有害收垃圾消费积分"></el-table-column> -->
                <!-- <el-table-column prop="youhairemaining" label="有害收垃圾剩余积分"></el-table-column> -->
                <!-- <el-table-column prop="qitaintegral" label="其他收垃圾累计积分"></el-table-column> -->
                <!-- <el-table-column prop="qitascore" label="其他收垃圾消费积分"></el-table-column> -->
                <!-- <el-table-column prop="qitaremaining" label="其他收垃圾剩余积分"></el-table-column> -->
                <el-table-column  label="累计积分">
                    <template scope="scope">
                        <div class="u" @click="getMore(scope.row)">{{ scope.row.totalintegral }}</div>
                    </template>
                </el-table-column>
                <el-table-column  label="消费积分">
                    <template scope="scope">
                        <div class="u" @click="getscoreMore(scope.row)">{{ scope.row.totalscore }}</div>
                    </template>
                </el-table-column>
                <el-table-column prop="totalremaining" label="剩余积分"></el-table-column>
                <!-- <el-table-column label="垃圾分类">
                    <template slot-scope="scope">￥{{scope.row.money}}</template>
                </el-table-column>
                <el-table-column prop="address" label="积分类型"></el-table-column>
                <el-table-column label="状态" align="center">
                    <template slot-scope="scope">
                        <el-tag
                            :type="scope.row.state==='成功'?'success':(scope.row.state==='失败'?'danger':'')"
                        >{{scope.row.state}}</el-tag>
                    </template>
                </el-table-column>

                <el-table-column prop="date" label="分数规则(分)"></el-table-column> -->
                <!-- <el-table-column label="操作" width="180" align="center">
                    <template slot-scope="scope">
                        <el-button
                            type="text"
                            @click="detail(scope.$index, scope.row)" style="color:#07C4A8"
                        >积分明细</el-button>
                    </template>
                </el-table-column> -->
            </el-table>
            <div class="pagination">
                <el-pagination
                    background
                    layout="total, sizes, prev, pager, next, jumper"
                    :current-page="currentPage"  
                    :page-size="pageSize"
                    :total="tableData.length"
                    @size-change="handleSizeChange"
                    @current-change="handlePageChange"
                ></el-pagination>
            </div>
            <!-- 编辑弹出框 -->
            <el-dialog v-dialogDrag title="信息" :visible.sync="editVisible" width="50%" >
                <el-form ref="form" :model="form" label-width="70px" class="diaglos display">
                    <el-form-item label="街道名称：" :label-width="formLabelWidth" class="wid50">
                        <input v-model="form.address" class="inputstyle" type="text" disabled="disabled"></input>
                    </el-form-item>
                    <el-form-item label="日期范围：" :label-width="formLabelWidth" class="wid50">
                        <input v-model="form.date" class="inputstyle" type="text" disabled="disabled"></input>
                    </el-form-item>
                    <el-form-item label="可回收垃圾累计积分：" :label-width="formLabelWidth" class="wid50">
                        <input v-model="form.integral" class="inputstyle" type="text" disabled="disabled"></input>
                    </el-form-item>
                    <!-- <el-form-item label="可回收垃圾消费积分：" :label-width="formLabelWidth" class="wid50">
                        <el-input v-model="form.score"></el-input>
                    </el-form-item> -->
                    <!-- <el-form-item label="可回收垃圾剩余积分：" :label-width="formLabelWidth" class="wid50">
                        <el-input v-model="form.remaining"></el-input>
                    </el-form-item> -->
                    <el-form-item label="厨余垃圾累计积分：" :label-width="formLabelWidth" class="wid50">
                        <input v-model="form.chuyuintegral" class="inputstyle" type="text" disabled="disabled"></input>
                    </el-form-item>
                    <!-- <el-form-item label="厨余垃圾消费积分：" :label-width="formLabelWidth" class="wid50">
                        <el-input v-model="form.chuyuscore"></el-input>
                    </el-form-item> -->
                    <!-- <el-form-item label="厨余垃圾剩余积分：" :label-width="formLabelWidth" class="wid50">
                        <el-input v-model="form.chuyuremaining"></el-input>
                    </el-form-item> -->
                    <el-form-item label="有害垃圾累计积分：" :label-width="formLabelWidth" class="wid50">
                        <input v-model="form.youhaiintegral" class="inputstyle" type="text" disabled="disabled"></input>
                    </el-form-item> 
                    <!-- <el-form-item label="有害垃圾消费积分：" :label-width="formLabelWidth" class="wid50">
                        <el-input v-model="form.youhaiscore"></el-input>
                    </el-form-item> -->
                    <!-- <el-form-item label="有害垃圾剩余积分：" :label-width="formLabelWidth" class="wid50">
                        <el-input v-model="form.youhairemaining"></el-input>
                    </el-form-item> -->
                    <el-form-item label="其他垃圾累计积分：" :label-width="formLabelWidth" class="wid50">
                        <input v-model="form.qitaintegral" class="inputstyle" type="text" disabled="disabled"></input>
                    </el-form-item> 
                    <!-- <el-form-item label="其他垃圾消费积分：" :label-width="formLabelWidth" class="wid50">
                        <el-input v-model="form.qitascore"></el-input>
                    </el-form-item> -->
                    <!-- <el-form-item label="其他垃圾剩余积分：" :label-width="formLabelWidth" class="wid50">
                        <el-input v-model="form.qitaremaining"></el-input>
                    </el-form-item> -->
                </el-form>
                <span slot="footer" class="dialog-footer">
                    <el-button @click="editVisible = false">取 消</el-button>
                    <el-button type="primary" @click="saveEdit">确 定</el-button>
                </span>
            </el-dialog>

              <!-- 积分明细弹出框 -->
            <el-dialog title="积分明细" :visible.sync="detaildialog" width="30%" >
                <!-- <div class='time-line' style="height:300px;overflow-y: scroll">
	            <div v-for='item in testList' class='time-line-div'>
            		<p>{{item.time}}</p>
            		<p ref='circular'></p>
            		<p>{{item.text}}</p>
	            </div>
	            <div class='img-dotted' ref='dotted'></div>
                </div> -->
                <div class="block scrolly" style="height:300px;">
                    <el-timeline >
                      <el-timeline-item 
                        v-for="(activity,index) in avtives"
                        :key='index'
                        :size='activity.size'
                        :color='activity.color'
                        :timestamp="activity.data" 
                        placement="top"
                        >
                        <el-card style="border:2px solid #cecece">
                          <h4>{{activity.content}}</h4>
                          <p>{{activity.name}} 提交于 {{activity.timestamp}}</p>
                        </el-card>
                      </el-timeline-item>
                      <!-- <el-timeline-item timestamp="2018/4/3" placement="top">
                        
                      </el-timeline-item>
                      <el-timeline-item timestamp="2018/4/2" placement="top">
                        <el-card>
                          <h4>更新 Github 模板</h4>
                          <p>王小虎 提交于 2018/4/2 20:46</p>
                        </el-card>
                      </el-timeline-item>
                      <el-timeline-item timestamp="2018/4/2" placement="top">
                        <el-card>
                          <h4>更新 Github 模板</h4>
                          <p>王小虎 提交于 2018/4/2 20:46</p>
                        </el-card>
                      </el-timeline-item>
                      <el-timeline-item timestamp="2018/4/2" placement="top">
                        <el-card>
                          <h4>更新 Github 模板</h4>
                          <p>王小虎 提交于 2018/4/2 20:46</p>
                        </el-card>
                      </el-timeline-item>
                      <el-timeline-item timestamp="2018/4/2" placement="top">
                        <el-card>
                          <h4>更新 Github 模板</h4>
                          <p>王小虎 提交于 2018/4/2 20:46</p>
                        </el-card>
                      </el-timeline-item>
                      <el-timeline-item timestamp="2018/4/2" placement="top">
                        <el-card>
                          <h4>更新 Github 模板</h4>
                          <p>王小虎 提交于 2018/4/2 20:46</p>
                        </el-card>
                      </el-timeline-item> -->
                    </el-timeline>
                </div>
                 <span slot="footer" class="dialog-footer">
                    <el-button @click="detaildialog = false">取 消</el-button>
                    <!-- <el-button type="primary" @click="saveEdit">确 定</el-button> -->
                </span>
            </el-dialog>
            <!-- 累计积分明细 -->
             <el-dialog v-dialogDrag title="累计积分明细" :visible.sync="getmoredialog" width="50%" >
                 <ul v-for="item in communitydetaildata">
                     <li v-for="items in item.communname" style="border-bottom:1px solid #ccc">
                         <p style="display:flex;padding:10px"><b style="display: inline;">社区名称：</b><span style="display: inline;">{{items.name}}</span></p>
                         <p style="display:flex;padding:10px"><b style="display: inline;">吨数：</b><span style="display: inline;">{{items.communtonnage}}</span></p>
                     </li>
                 </ul>
                 <!-- <el-form v-for="item in communitydetaildata">
                    <el-form-item label="社区名称：" :label-width="formLabelWidth" class="wid50">
                        <input prop= class="inputstyle" type="text" disabled="disabled">{{item.name}}</input>
                    </el-form-item>
                 </el-form> -->
                 <!-- <form action="" v-for="item in communitydetaildata">
                    
                 </form> -->
                 <!-- <ul v-for="item in communitydetaildata">
                     <li v-for="items in item.communname">
                         
                         <label for="" label='社区名称：'>{{items.name}}</label>
                         <label for="" label='吨数：'>{{items.communtonnage}}</label>
                         <!-- <p v-for="itemname in items">{{itemname}}</p>
                     </li>
                 </ul> -->
                 <!-- <ul v-for="item in communitydetaildata">
                     <li v-for="items in item">
                         <p></p>
                     </li>
                 </ul> -->
                 
                <!-- <el-form ref="form" :model="form" label-width="70px" class="diaglos display" v-for="item in communitydetaildata">
                    <el-form-item label="社区名称12：" :label-width="formLabelWidth" class="wid50">
                        <input v-model="form.address" class="inputstyle" type="text" disabled="disabled">{{item}}</input>
                    </el-form-item>
                    <el-form-item label="日期范围：" :label-width="formLabelWidth" class="wid50">
                        <input v-model="form.date" class="inputstyle" type="text" disabled="disabled"></input>
                    </el-form-item> -->
                    <!-- <el-form-item label="可回收垃圾累计积分：" :label-width="formLabelWidth" class="wid50">
                        <input v-model="form.integral" class="inputstyle" type="text" disabled="disabled"></input>
                    </el-form-item> -->
                    <!-- <el-form-item label="可回收垃圾消费积分：" :label-width="formLabelWidth" class="wid50">
                        <el-input v-model="form.score"></el-input>
                    </el-form-item> -->
                    <!-- <el-form-item label="可回收垃圾剩余积分：" :label-width="formLabelWidth" class="wid50">
                        <el-input v-model="form.remaining"></el-input>
                    </el-form-item> -->
                    <!-- <el-form-item label="厨余垃圾累计积分：" :label-width="formLabelWidth" class="wid50">
                        <input v-model="form.chuyuintegral" class="inputstyle" type="text" disabled="disabled"></input>
                    </el-form-item> -->
                    <!-- <el-form-item label="厨余垃圾消费积分：" :label-width="formLabelWidth" class="wid50">
                        <el-input v-model="form.chuyuscore"></el-input>
                    </el-form-item> -->
                    <!-- <el-form-item label="厨余垃圾剩余积分：" :label-width="formLabelWidth" class="wid50">
                        <el-input v-model="form.chuyuremaining"></el-input>
                    </el-form-item> -->
                    <!-- <el-form-item label="有害垃圾累计积分：" :label-width="formLabelWidth" class="wid50">
                        <input v-model="form.youhaiintegral" class="inputstyle" type="text" disabled="disabled"></input>
                    </el-form-item>  -->
                    <!-- <el-form-item label="有害垃圾消费积分：" :label-width="formLabelWidth" class="wid50">
                        <el-input v-model="form.youhaiscore"></el-input>
                    </el-form-item> -->
                    <!-- <el-form-item label="有害垃圾剩余积分：" :label-width="formLabelWidth" class="wid50">
                        <el-input v-model="form.youhairemaining"></el-input>
                    </el-form-item> -->
                    <!-- <el-form-item label="其他垃圾累计积分：" :label-width="formLabelWidth" class="wid50">
                        <input v-model="form.qitaintegral" class="inputstyle" type="text" disabled="disabled"></input>
                    </el-form-item>  -->
                    <!-- <el-form-item label="其他垃圾消费积分：" :label-width="formLabelWidth" class="wid50">
                        <el-input v-model="form.qitascore"></el-input>
                    </el-form-item> -->
                    <!-- <el-form-item label="其他垃圾剩余积分：" :label-width="formLabelWidth" class="wid50">
                        <el-input v-model="form.qitaremaining"></el-input>
                    </el-form-item> -->
                <!-- </el-form> -->
                <!-- <span slot="footer" class="dialog-footer">
                    <el-button @click="getmoredialog = false">取 消</el-button>
                    <el-button type="primary" @click="saveEdit">确 定</el-button>
                </span> -->
            </el-dialog>
            <!-- 消费积分明细 -->
             <el-dialog v-dialogDrag title="消费积分明细" :visible.sync="getscoremoredialog" width="50%" >
                 <ul v-for="item in communitydetaildata">
                     <li v-for="items in item.communname" style="border-bottom:1px solid #ccc">
                         <p style="display:flex;padding:10px"><b style="display: inline;">社区名称：</b><span style="display: inline;">{{items.name}}</span></p>
                         <p style="display:flex;padding:10px"><b style="display: inline;">吨数：</b><span style="display: inline;">{{items.communtonnage}}</span></p>
                     </li>
                 </ul>
            </el-dialog>
            <!-- 新增弹出框 -->
             <el-dialog v-dialogDrag title="新增" :visible.sync="adddatevialog" width="50%" >
                 <el-form ref="addform" :model="addform" label-width="70px" class="diaglos display">
                    <el-form-item label="街道名称：" :label-width="formLabelWidth" class="wid50">
                        <el-input v-model="addform.address" ></el-input>
                    </el-form-item>
                    <el-form-item label="街道累计积分：" :label-width="formLabelWidth" class="wid50">
                        <el-input v-model="addform.totalintegral"></el-input>
                    </el-form-item>
                    <el-form-item label="街道消费积分：" :label-width="formLabelWidth" class="wid50">
                        <el-input v-model="addform.totalscore"></el-input>
                    </el-form-item>
                    <el-form-item label="街道剩余积分：" :label-width="formLabelWidth" class="wid50">
                        <el-input v-model="addform.totalremaining"></el-input>
                    </el-form-item> 
                </el-form>
                <span slot="footer" class="dialog-footer">
                    <el-button @click="adddatevialog = false">取 消</el-button>
                    <el-button type="primary" @click="saveEditvialog">确 定</el-button>
                </span>
            </el-dialog>
        </div>
</template>
<script>
import '../../../assets/css/common.css'

export default {
    data(){
        return{
              currentPage:1, //初始页
                pagesize:10,    //    每页的数据
                userList: [],
                address:'',
                name:'',
                value1: '',
                search: '',
                streetname:'',
                detaildialog:false,
                getmoredialog:false,    //累计积分明细
                getscoremoredialog:false,   //消费积分明细
                addform:{
                    address:'',
                    totalintegral:'',
                    totalscore:'',
                    totalremaining:''
                },
                avtives: [{
                content: '支持自定义颜色',
                timestamp: '2018-04-03 20:46',
                color: '#0bbd87',
                size: 'large',
                name: '张茜',
                data: '2018-04-03',

            },{
                content: '支持自定义颜色',
                timestamp: '2018-04-03 20:46',
                color: '#0bbd87',
                name: '张茜',
                data: '2018-04-03'
            },{
                content: '支持自定义颜色',
                timestamp: '2018-04-03 20:46',
                color: '#0bbd87',
                name: '张茜',
                data: '2018-04-03'
            },{
                content: '支持自定义颜色',
                timestamp: '2018-04-03 20:46',
                color: '#0bbd87',
                name: '张茜',
                data: '2018-04-03'
            },{
                content: '支持自定义颜色',
                timestamp: '2018-04-03 20:46',
                color: '#0bbd87',
                name: '张茜',
                data: '2018-04-03'
            },{
                content: '支持自定义颜色',
                timestamp: '2018-04-03 20:46',
                color: '#0bbd87',
                name: '张茜',
                data: '2018-04-03'
            },],
            tableData: [{
                id: '1',
                address: "街道1",
                date: '2020-7-1~2020-7-30',
                integral: '100',
                score: '2',
                remaining:'98',
                chuyuintegral: '200',
                chuyuscore: '1',
                chuyuremaining: '199',
                youhaiintegral: '100',
                youhaiscore:　'2',
                youhairemaining:　'98',
                qitaintegral: '100',
                qitascore: '5',
                qitaremaining: '95',
                totalintegral: '500',
                totalscore: '358',
                totalremaining: '142',

            },{
                id: '2',
                address: "街道2",
                date: '2020-7-1~2020-7-20',
                integral: '100',
                score: '2',
                remaining:'98',
                chuyuintegral: '200',
                chuyuscore: '1',
                chuyuremaining: '199',
                youhaiintegral: '100',
                youhaiscore:　'2',
                youhairemaining:　'98',
                qitaintegral: '100',
                qitascore: '5',
                qitaremaining: '95',
                totalintegral: '500',
                totalscore: '358',
                totalremaining: '142'
            },{
                id: '3',
                 address: "街道3",
                date: '2020-7-1~2020-7-30',
                integral: '100',
                score: '2',
                remaining:'98',
                chuyuintegral: '200',
                chuyuscore: '1',
                chuyuremaining: '199',
                youhaiintegral: '100',
                youhaiscore:　'2',
                youhairemaining:　'98',
                qitaintegral: '100',
                qitascore: '5',
                qitaremaining: '95',
                totalintegral: '500',
                totalscore: '358',
                totalremaining: '142'
            },{
                id: '4',
                 address: "街道4",
                date: '2020-7-1~2020-7-30',
                integral: '100',
                score: '2',
                remaining:'98',
                chuyuintegral: '200',
                chuyuscore: '1',
                chuyuremaining: '199',
                youhaiintegral: '100',
                youhaiscore:　'2',
                youhairemaining:　'98',
                qitaintegral: '100',
                qitascore: '5',
                qitaremaining: '95',
                totalintegral: '500',
                totalscore: '358',
                totalremaining: '142'
            },{
                id: '5',
                 address: "街道5",
                date: '2020-7-1~2020-7-30',
                integral: '100',
                score: '2',
                remaining:'98',
                chuyuintegral: '200',
                chuyuscore: '1',
                chuyuremaining: '199',
                youhaiintegral: '100',
                youhaiscore:　'2',
                youhairemaining:　'98',
                qitaintegral: '100',
                qitascore: '5',
                qitaremaining: '95',
                totalintegral: '500',
                totalscore: '358',
                totalremaining: '142'
            },{
                id: '6',
                 address: "街道6",
                date: '2020-7-1~2020-7-30',
                integral: '100',
                score: '2',
                remaining:'98',
                chuyuintegral: '200',
                chuyuscore: '1',
                chuyuremaining: '199',
                youhaiintegral: '100',
                youhaiscore:　'2',
                youhairemaining:　'98',
                qitaintegral: '100',
                qitascore: '5',
                qitaremaining: '95',
                totalintegral: '500',
                totalscore: '358',
                totalremaining: '142'
            },{
                id: '7',
                 address: "街道7",
                date: '2020-7-1~2020-7-30',
                integral: '100',
                score: '2',
                remaining:'98',
                chuyuintegral: '200',
                chuyuscore: '1',
                chuyuremaining: '199',
                youhaiintegral: '100',
                youhaiscore:　'2',
                youhairemaining:　'98',
                qitaintegral: '100',
                qitascore: '5',
                qitaremaining: '95',
                totalintegral: '500',
                totalscore: '358',
                totalremaining: '142'
            },{
                id: '8',
                 address: "街道8",
                date: '2020-7-1~2020-7-30',
                integral: '100',
                score: '2',
                remaining:'98',
                chuyuintegral: '200',
                chuyuscore: '1',
                chuyuremaining: '199',
                youhaiintegral: '100',
                youhaiscore:　'2',
                youhairemaining:　'98',
                qitaintegral: '100',
                qitascore: '5',
                qitaremaining: '95',
                totalintegral: '500',
                totalscore: '358',
                totalremaining: '142'
            },{
                id: '9',
                 address: "街道9",
                date: '2020-7-1~2020-7-30',
                integral: '100',
                score: '2',
                remaining:'98',
                chuyuintegral: '200',
                chuyuscore: '1',
                chuyuremaining: '199',
                youhaiintegral: '100',
                youhaiscore:　'2',
                youhairemaining:　'98',
                qitaintegral: '100',
                qitascore: '5',
                qitaremaining: '95',
                totalintegral: '500',
                totalscore: '358',
                totalremaining: '142'
            },{
                id: '10',
                 address: "街道10",
                date: '2020-7-1~2020-7-30',
                integral: '100',
                score: '2',
                remaining:'98',
                chuyuintegral: '200',
                chuyuscore: '1',
                chuyuremaining: '199',
                youhaiintegral: '100',
                youhaiscore:　'2',
                youhairemaining:　'98',
                qitaintegral: '100',
                qitascore: '5',
                qitaremaining: '95',
                totalintegral: '500',
                totalscore: '358',
                totalremaining: '142'
            },{
                id: '11',
                 address: "街道11",
                date: '2020-7-1~2020-7-30',
                integral: '100',
                score: '2',
                remaining:'98',
                chuyuintegral: '200',
                chuyuscore: '1',
                chuyuremaining: '199',
                youhaiintegral: '100',
                youhaiscore:　'2',
                youhairemaining:　'98',
                qitaintegral: '100',
                qitascore: '5',
                qitaremaining: '95',
                totalintegral: '500',
                totalscore: '358',
                totalremaining: '142'
            },{
                id: '12',
                 address: "街道12",
                date: '2020-7-1~2020-7-30',
                integral: '100',
                score: '2',
                remaining:'98',
                chuyuintegral: '200',
                chuyuscore: '1',
                chuyuremaining: '199',
                youhaiintegral: '100',
                youhaiscore:　'2',
                youhairemaining:　'98',
                qitaintegral: '100',
                qitascore: '5',
                qitaremaining: '95',
                totalintegral: '500',
                totalscore: '358',
                totalremaining: '142'
            }],
            multipleSelection: [],
            delList: [],
            editVisible: false,
            pageTotal: 0,
            form: {},
            idx: -1,
            id: -1,
            formLabelWidth:'160px',
            communitydetail:[{
                index:'1',
                communname:[{
                    name: '礼嘉景园社区',
                    communtonnage: '100'
                },{
                    name: '蒂花里社区',
                    communtonnage: '100'
                },{
                    name: '礼嘉景园社区',
                    communtonnage: '100'
                },{
                    name: '万科社区',
                    communtonnage: '100'
                },{
                    name: '礼嘉景园社区',
                    communtonnage: '100'
                },]
            },{
                index:'2',
               communname:[{
                    name: '礼嘉景园社区',
                    communtonnage: '100'
                },{
                    name: '蒂花里社区',
                    communtonnage: '100'
                },{
                    name: '礼嘉景园社区',
                    communtonnage: '100'
                },{
                    name: '万科社区',
                    communtonnage: '100'
                },{
                    name: '礼嘉景园社区',
                    communtonnage: '100'
                },]              
            },{
                index:'3',
               communname:[{
                    name: '礼嘉景园社区',
                    communtonnage: '100'
                },{
                    name: '蒂花里社区',
                    communtonnage: '100'
                },{
                    name: '礼嘉景园社区',
                    communtonnage: '100'
                },{
                    name: '万科社区',
                    communtonnage: '100'
                },{
                    name: '礼嘉景园社区',
                    communtonnage: '100'
                },]            
            },{
                index:'4',
                communname:[{
                    name: '礼嘉景园社区',
                    communtonnage: '100'
                },{
                    name: '蒂花里社区',
                    communtonnage: '100'
                },{
                    name: '礼嘉景园社区',
                    communtonnage: '100'
                },{
                    name: '万科社区',
                    communtonnage: '100'
                },{
                    name: '礼嘉景园社区',
                    communtonnage: '100'
                },]               
            },{
                index:'5',
               communname:[{
                    name: '礼嘉景园社区',
                    communtonnage: '100'
                },{
                    name: '蒂花里社区',
                    communtonnage: '100'
                },{
                    name: '礼嘉景园社区',
                    communtonnage: '100'
                },{
                    name: '万科社区',
                    communtonnage: '100'
                },{
                    name: '礼嘉景园社区',
                    communtonnage: '100'
                },]              
            },{
                index:'6',
                communname:[{
                    name: '礼嘉景园社区',
                    communtonnage: '100'
                },{
                    name: '蒂花里社区',
                    communtonnage: '100'
                },{
                    name: '礼嘉景园社区',
                    communtonnage: '100'
                },{
                    name: '万科社区',
                    communtonnage: '100'
                },{
                    name: '礼嘉景园社区',
                    communtonnage: '100'
                },]               
            },{
                index: '7',
                communname:[{
                    name: '礼嘉景园社区',
                    communtonnage: '100'
                },{
                    name: '蒂花里社区',
                    communtonnage: '100'
                },{
                    name: '礼嘉景园社区',
                    communtonnage: '100'
                },{
                    name: '万科社区',
                    communtonnage: '100'
                },{
                    name: '礼嘉景园社区',
                    communtonnage: '100'
                },]               
            },{
                index:'8',
                communname:[{
                    name: '礼嘉景园社区',
                    communtonnage: '100'
                },{
                    name: '蒂花里社区',
                    communtonnage: '100'
                },{
                    name: '礼嘉景园社区',
                    communtonnage: '100'
                },{
                    name: '万科社区',
                    communtonnage: '100'
                },{
                    name: '礼嘉景园社区',
                    communtonnage: '100'
                },]                
            },{
                index:'9',
                communname:[{
                    name: '礼嘉景园社区',
                    communtonnage: '100'
                },{
                    name: '蒂花里社区',
                    communtonnage: '100'
                },{
                    name: '礼嘉景园社区',
                    communtonnage: '100'
                },{
                    name: '万科社区',
                    communtonnage: '100'
                },{
                    name: '礼嘉景园社区',
                    communtonnage: '100'
                },]                
            },{
                index:'10',
                communname:[{
                    name: '礼嘉景园社区',
                    communtonnage: '100'
                },{
                    name: '蒂花里社区',
                    communtonnage: '100'
                },{
                    name: '礼嘉景园社区',
                    communtonnage: '100'
                },{
                    name: '万科社区',
                    communtonnage: '100'
                },{
                    name: '礼嘉景园社区',
                    communtonnage: '100'
                },]                
            },{
                index:'11',
                communname:[{
                    name: '礼嘉景园社区',
                    communtonnage: '100'
                },{
                    name: '蒂花里社区',
                    communtonnage: '100'
                },{
                    name: '礼嘉景园社区',
                    communtonnage: '100'
                },{
                    name: '万科社区',
                    communtonnage: '100'
                },{
                    name: '礼嘉景园社区',
                    communtonnage: '100'
                },]               
            },{
                index:'12',
                communname:[{
                    name: '礼嘉景园社区',
                    communtonnage: '100'
                },{
                    name: '蒂花里社区',
                    communtonnage: '100'
                },{
                    name: '礼嘉景园社区',
                    communtonnage: '100'
                },{
                    name: '万科社区',
                    communtonnage: '100'
                },{
                    name: '礼嘉景园社区',
                    communtonnage: '100'
                },]                
            }],
            communitydetaildata:'',
            adddatevialog:false,
        }
    },
    created() {
        // this.getData();
    },
    methods: {
        // 获取 easy-mock 的模拟数据
        // getData() {
        //     fetchData(this.query).then(res => {
        //         console.log(res);
        //         this.tableData = res.list;
        //         this.pageTotal = res.pageTotal || 50;
        //     });
        // },
        // 触发搜索按钮
        // handleSearch() {
        //     this.$set(this.query, 'pageIndex', 1);
        //     // this.getData();
        // },
        async saveEditvialog(){
            this.adddatevialog = false
        },
        //新增弹出框
        async addvialog(){
            this.adddatevialog = true
        },
        //累计积分弹框
        async getMore(row){
            this.communitydetaildata =this.communitydetail.filter((item,index)=>{
                if(row.id == item.index){
                    console.log(item)
                   return item.communname
                }
                this.streetname == item.address
            })
            this.getmoredialog = true
            console.log(row);
        },
         //消费积分弹框
        async getscoreMore(row){
            this.communitydetaildata =this.communitydetail.filter((item,index)=>{
                if(row.id == item.index){
                    console.log(item)
                   return item.communname
                }
            })
            this.getscoremoredialog = true
            console.log(row);
        },
        // 积分明细弹框
        async detail(index,row){
            console.log(index,row)
            this.detaildialog = true;
        },
         mohu() {
            var search = this.name;
            console.log(search)
            var newdate = [];
            if(search){
                if(search)
                 this.tableData.filter(item=>{
                    if(item.name.indexOf(search) != -1){
                        newdate.push(item)
                    }
                })
            }else if (search == ''){
                console.log(this.tableData)
            }
            this.tableData = newdate
        },
        // 编辑操作
        handleEdit(index, row) {
            this.idx = index;
            this.form = row;
            this.editVisible = true;
        },
        // 保存编辑
        saveEdit() {
            this.editVisible = false;
            this.$message.success(`修改第 ${this.idx + 1} 行成功`);
            this.$set(this.tableData, this.idx, this.form);
        },
        // 分页导航
        handlePageChange(currentPage) {
            this.currentPage = currentPage;
            console.log(this.currentPage)
            // this.$set(this.query, 'pageIndex', val);
            // this.getData();
        },
        handleSizeChange(size){
            this.pagesize = size;
            console.log(this.pagesize)
        }
    }
}
</script>
<style scoped>
    .el-form-item__label{
        width: 140px!important;
    }
</style>